import React, { Component } from 'react';
class Search extends Component {
    state = {
        content:'',
    }
    changeInput=(e)=>{
        this.setState({
            content:e.target.value
        })
    }
    // 查询
    getSearch=()=>{
        // console.log(this.state.content);
        this.props.search(this.state.content)
    }
    render() {
        return (<>
            <div className='search'>
                <input placeholder='' className='input' value={this.state.content} onChange={this.changeInput}></input>
                <button onClick={this.getSearch}>百度一下</button>
            </div>
        </>);
    }
}

export default Search;